package com.myjava.list;

import java.util.ArrayList;
import java.util.List;

public class ListClass {
    public static void main(String[] args) {
          List list = new ArrayList();
          list.add("a");
          list.add("a");
          list.add("a");
          //根据角标添加元素
          list.add(1,"martin");
        System.out.println(list);
        //获取对应角标的元素
        System.out.println(list.get(2));
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
            
        }

    }
}
